"""3.3 **循环结构—for...in形式**
for 变量 in 可迭代的对象:
    语句块

可迭代的对象可以是字符串、列表、元组、字典、集合、range()等。
"""
# for...in 列表
fruits=['orange','apple','banana']
print("===for...in 列表")
for fruit in fruits:
    print(fruit)

# for...in 字符串
print("===for...in 字符串")
str1="hello,world"
for char in str1:
    print(char)

# for...in 元组
print("===for...in 元组")
tup1=(1,2,3,4,5)
for num in tup1:
    print(num)

#for...in 字典
print("===for...in 字典")
dict1={'name':'Tom','age':20,'gender':'male'}
for key in dict1:
    print(key,dict1[key])
print("===for...in 字典 (2)")
for key,value in dict1.items():
    print(key,value)